<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/MemberTemplate.xhtml">

    <ui:define name="contentInsert">
        <h:form id="myform">

            <p:dataTable var="reservation" value="#{customerReservationManagedBean.reservationByCus}" id="reservationList"
                         paginator="true" rows="20">
                <f:facet name="header" >
                    <h:outputText value="#{customerReservationManagedBean.customerEmail}"/>
                </f:facet>
                <p:column headerText="Reservation Id" style="width:15%">
                    <h:outputText value="#{reservation.id}"/>
                </p:column>
                <p:column headerText="Time" style="width:150px" sortBy="#{reservation.dateStr}">
                    <h:outputText value="#{reservation.dateStr}"/>
                </p:column>
                <p:column headerText="Date" style="width:150px" sortBy="#{reservation.timeStr}">
                    <h:outputText value="#{reservation.timeStr}"/>
                </p:column>
                <p:column headerText="Area" style="width:10%" >
                    <h:outputText value="#{reservation.area.areaName}"/>
                </p:column>
                <p:column headerText="Confirm status" style="width:150px" >
                    <h:outputText value="#{reservation.statusStr}"/>
                </p:column>
                <p:column headerText="Option">
                    <p:commandButton   value="Delete This Reservation" onclick="if (!confirm('Are you sure you want to delete outlet?')) return false"
                                       action="#{customerReservationManagedBean.cancelMessage(reservation)}" ajax="false" update="myform"
                                       disabled="#{reservation.confirmStatus?true:false}">
                    </p:commandButton>
                </p:column>

            </p:dataTable>  

        </h:form>
        <h:form>
            
        </h:form>

    </ui:define>
</ui:composition>

